package at.jsug.topicvoting.gwt1.client.remote;

import java.util.HashSet;
import java.util.Set;

abstract class AbstractDataService implements IDataFacade {

	private final Set<IDataMonitor> monitors = new HashSet<IDataMonitor>();
	
	public final void addMonitor(IDataMonitor monitor) {
		this.monitors.add(monitor);
	}

	
	protected final void broadcastDataChange() {
		for (IDataMonitor monitor : this.monitors) {
			monitor.dataChanged();
		}
	}

}
